<div ng-controller="PrintCtrl" ng-init="tmplatebindingAction()" class="sui-form form-horizontal" ng-keydown="deletes($event)">
    <ul class="sui-breadcrumb">
        <li><a href="#/print/list?type_id={{type_id}}">绑定模板列表</a></li>
        <li class="active">{{tpldata.shop_config_id?'edit':'add_new' | translate}}</li>
    </ul>
    <!-- <div class="sui-row-fluid"><printer  shopid="{{tpid}}" ></printer>  </div> -->
    <!-- <button ng-click="print()">打印 </button> -->
    <div>
        <table class="sui-table table-bordered" ng-if="relations">
            <thead>
                <tr>
                    <th>
                        编号
                    </th>
                    <th>
                        模板名称
                    </th>
                    <th>
                        数量
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="relation in relations">
                    <td>{{relation.relation_id}}</td>
                    <td>
                        <template-name ng-model="relation.template_id"></template-name>
                    </td>
                    <td>
                        {{relation.num}}
                    </td>
                    <td>
                        <button ng-click="delrelation(relation.relation_id,$event)" class="sui-btn btn-danger"> 删除绑定模板</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div>
        <print-type-tab ng-model="chosedType" click-tab="getlist()"></print-type-tab>
        <table class="sui-table table-bordered" ng-repeat=" (tpMlkey, prints) in tpMl">
            <thead>
                <tr>
                    <th colspan="4">
                        <carryway-type ng-model="tpMlkey" stype="1"></carryway-type>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="print in prints">
                    <td>{{print.name}}</td>
                    <td>
                        <carryway-type ng-model="print.shipping_corp" stype="1"></carryway-type>
                    </td>
                    <td>
                        <carryway-type ng-model="print.shipping_corp" stype="1"></carryway-type>
                    </td>
                    <td>
                        <button ng-click="addrelation(print.print_id,$event)" class="sui-btn btn-success"> 绑定模板</button>
                    </td>
                </tr>
            </tbody>
        </table>
        <!-- 分页start -->
        <pager page-no="1" page-size="pageSize" total="printTotal" get-data="getlist(pageNo)"></pager>
        <!-- 分页end -->
    </div>
</div>